{extend name="public:common"}
{block name="head"}
<style>
    .container {
        margin: 0;
        height: 10rem;
        padding-top: 8rem;
    }
</style>
{/block}
{block name="content"}
<div class="container mdui-color-theme">
    <div class="mdui-container">
        <div class="mdui-row">
            <div class="mdui-col-xs-12 mdui-col-sm-6 mdui-col-offset-sm-3 mdui-color-white" style="border-radius: 5px;">
                <form action="" method="POST">
                    <div class="mdui-textfield">
                        <i class="mdui-icon material-icons">search</i>
                        <input class="mdui-textfield-input" type="search" placeholder="搜索模块..." name="keyword" />
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class="mdui-container">
    <div class="mdui-row">
        <div class="mdui-col-xs-12">
            <div class="mdui-card mdui-typo">
                <div class="mdui-card-header">
                    <div class="mdui-typo-display-1">搜索：{if !empty($keyword)}{$keyword}{/if}</div>
                </div>
            </div>

            <div class="mdui-table-fluid mdui-m-t-5">
                <table class="mdui-table">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>模块名称</th>
                            <th>模块MD5</th>
                            <th>模块版本</th>
                            <th>上传时间</th>
                            <th>引用名称</th>
                            <th>上传用户</th>
                        </tr>
                    </thead>
                    <tbody>
                        {if !empty($list)}
                        {volist name="list" id="vo" empty="暂时没有数据"}
                        <tr>
                            <td>{$i}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.hash}</td>
                            <td>V{$vo.version}</td>
                            <td>{$vo.create_time}</td>
                            <td>
                                <button id="copy" title="点击复制" class="mdui-btn mdui-color-theme-accent"
                                    data-clipboard-text="{$vo.call_name}">{$vo.call_name}</button>
                            </td>
                            <td>{$vo.email}</td>
                        </tr>
                        {/volist}
                        {/if}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script src="https://cdn.bootcss.com/clipboard.js/2.0.4/clipboard.min.js"></script>
<script>
    var cli = new ClipboardJS('#copy');
    cli.on('success', function () {
        mdui.snackbar({
            message: '复制成功！'
        });
    })
</script>
{/block}